var app = getApp();
Page({
    data:{
        siteroot : app.siteInfo.siteroot.replace('app/index.php', ''),uniacid: app.siteInfo.uniacid,
    },
    onLoad:function(options){
        var self = this;
        var zfid = options.zfid ? options.zfid : '';
        self.setData({
            options : options,
        });
        app.com.auth(function(user){
            app.com.http('fenxiao','POST',{zfid:zfid,op:'inviteshop'},0,false,'','',function(res){
                if (!res.data.errno) {
                    self.setData({
                        Pagetheme : res.data.data.params.style,
                        params : res.data.data.params,
                        sharedata : res.data.data.sharedata,
                        quest : res.data.data.quest,
                        inited : true,
                    });
                }else{
                    app.com.alert(res.data.message);
                }
            });
        });

        wx.setNavigationBarTitle({
          title:  '发展团队',
        });
       
    },
    onShareAppMessage : function(){
        var self = this;
        return {
            title: self.data.sharedata.title,
            path: self.data.sharedata.path,
            imageUrl : self.data.sharedata.img,
        }
    },
    openShareArea : function(e){
        var self = this;
        self.setData({
            SharePopupshow : !self.data.SharePopupshow
        })
        setTimeout(function(){
            self.setData({
                shareVisible : self.data.SharePopupshow ? 'visible' : ''
            })
        },300)
    },
    getPoster(){
        var self = this;
        app.com.http('poster','POST',{op:'user',path:self.data.sharedata.path},0,true,'','',function(res){
            if (!res.data.errno && res.data ) {
                wx.previewImage({
                    urls : [res.data.data.url]
                })
            }else{
                app.com.alert(res.data.message);
            }
        });
    },
    location : function( e ){
        app.com.location( e );
    },
    otherapp : function( e ){
        app.com.otherapp( e );
    },
    navigateto : function( e ){
        app.com.navigateto( e );
    },
    redirectto : function( e ){
        app.com.redirectto( e );
    },    
    callphone : function(e){
        app.com.callphone( e );
    },
    toweburl : function(e){
        app.com.toweburl( e );
    },
    showimages : function( e ){
        app.com.showimages( e );
    },
    footNavigate(e){
        var url = e.currentTarget.dataset.url;
        wx.switchTab({
          url: url
        })
    },

})